using System;
using System.Collections.Generic;
using System.Text;
using System.Net;

namespace Ares.CommonObjects
{
    public class ChannelListItem
    {
        public String last = String.Empty;
        public String name;
        public String topic;
        public ushort port;
        public ushort users;
        public IPAddress externalIp;
        public IPAddress localIp;
        public bool auto = false;

        public ChannelListItem()
        {
            Random rnd = new Random((int)cb0tServer.Helpers.UnixTime());
            byte[] tmp = new byte[4];

            for (int i = 0; i < 4; i++)
                tmp[i] = (byte)(rnd.NextDouble() * 256);

            this.localIp = new IPAddress(tmp);
        }

        public ChannelListItem(String name, String topic, ushort port,
            ushort users, IPAddress externalIp, IPAddress localIp)
        {
            this.name = name;
            this.topic = topic;
            this.port = port;
            this.users = users;
            this.externalIp = externalIp;
            this.localIp = localIp;
        }
    }

    public class ClientUserObject
    {
        public bool admin;
        public bool host;
        public bool browse;
        public IPAddress externalIp;
        public ushort files;
        public IPAddress localIp;
        public String name;
        public IPAddress nodeIp;
        public ushort nodePort;
        public ushort dcPort;
        public uint speed;
        public System.Drawing.Bitmap avatar = null;
        public String avatar_uploading = String.Empty;
        public String winamptext = String.Empty;
        public bool isMe = false;
    }

    class WinAmpSong
    {
        public String songname;
        public ushort samplerate;
        public ushort bitrate;
        public ushort listposition;
        public ushort listsize;
        public int songlength;
        public int songpos;

        public WinAmpSong()
        {
            this.songname = String.Empty;
            this.samplerate = 0;
            this.bitrate = 0;
            this.listposition = 0;
            this.listsize = 0;
            this.songlength = 0;
            this.songpos = 0;
        }

        public WinAmpSong(String songname,ushort samplerate, ushort bitrate,
            ushort listposition, ushort listsize, int songlength, int songpos)
        {
            this.songname = songname;
            this.samplerate = samplerate;
            this.bitrate = bitrate;
            this.listposition = listposition;
            this.listsize = listsize;
            this.songlength = songlength;
            this.songpos = songpos;
        }
    }
}
